<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .wrapper{
            width: 600px;
            height: 400px;
            border: 5px solid black;
            margin: 0 auto;
        }
        .box1,.box2,.box3{
            display: inline-block;
            width: 150px;
            height: 150px;
            border: 5px dotted red;
        }
        .box2{
            position: static;/*静态定位 不会发生偏移*/
            left: 100px;
            top: 200px;
        }
        .box2{
            position: absolute;/*绝对定位 会发生偏移*/
            left: 100px;
            top: 50px;
        }
    </style>
</head>
<body>
    <div class="wrapper">
        <div class="box1"></div>
        <div class="box2"></div>
        <div class="box3"></div>
    </div>
</body>
</html>